#pragma once
#include <iostream>

namespace krryn{
namespace scene{
	template
	<
		typename _Position, 
		typename _Color, 
		typename _Normal, 
		typename _UV,
		typename _VertexType
	>
	class vertex_description{
	public:
		typedef _Position position_type;
		typedef _Color color_type;
		typedef _Normal normal_type;
		typedef _UV uv_type;

		typedef _VertexType vertex_type;

		static const bool m_HasPosition	= position_type::m_Available;
		static const bool m_HasColor	= color_type::m_Available;
		static const bool m_HasNormal	= normal_type::m_Available;
		static const bool m_HasUV		= uv_type::m_Available;

		static const size_t m_TotalSize	= sizeof(vertex_type);

		static const size_t m_Stride	= position_type::m_Stride 
										+ color_type::m_Stride 
										+ normal_type::m_Stride 
										+ uv_type::m_Stride;

		static const size_t m_PositionOffset	= 0;
		static const size_t m_ColorOffset		= m_PositionOffset + position_type::m_Stride;
		static const size_t m_NormalOffset		= m_ColorOffset + color_type::m_Stride;
		static const size_t m_UVOffset			= m_NormalOffset + normal_type::m_Stride;

		static const size_t m_TexCoords	= uv_type::m_Size;

		friend std::ostream& operator<<(std::ostream& a_Stream, vertex_description &vd){
			return a_Stream
				<< std::boolalpha
				<< "vertex description: " << std::endl
				<< " - position: " << vd.m_HasPosition << std::endl
				<< " - color: " << vd.m_HasColor << std::endl
				<< " - normal: " << vd.m_HasNormal << std::endl
				<< " - uvs: " << vd.m_HasUV << " (" << vd.m_TexCoords << ")" << std::endl
				<< " - extra: " << vd.m_HasExtra << std::endl
				<< std::noboolalpha;
		}
	};
}
}